﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AVIS.OutBound.Infrastructure
{
    public static class CommonExtensions
    {
        /// <summary>
        /// 可忽略大小写进行比较
        /// </summary>
        /// <param name="source"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static bool ContainsIgnoreCase(this string source, string value)
        {
            return (source.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0);
        }

        /// <summary>
        /// 可忽略大小写进行比较
        /// </summary>
        /// <param name="source"></param>
        /// <param name="value"></param>
        /// <param name="comparisonType"></param>
        /// <returns></returns>
        public static bool Contains(this string source, string value, StringComparison comparisonType)
        {
            return (source.IndexOf(value, comparisonType) >= 0);
        }
    }
}
